package db.pojo;

import java.util.*;
import java.text.SimpleDateFormat;
import db.ext.Level_discountExt;
@SuppressWarnings("unchecked")
/**
 * level_discount
 */
public class Level_discount {
	/**
	 * ID
	 */
	public String iD;
	/**
	 * LEVEL
	 */
	public String lEVEL;
	/**
	 * LEVELNAME
	 */
	public String lEVELNAME;
	/**
	 * DISCOUNT
	 */
	public String dISCOUNT;
	SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	public static Level_discountExt DB = new Level_discountExt(); 
	
	public Level_discount() {
		super();
	}
	
	public Level_discount(String iD, String lEVEL, String lEVELNAME, String dISCOUNT) {
		super();
		this.iD = iD; 
		this.lEVEL = lEVEL; 
		this.lEVELNAME = lEVELNAME; 
		this.dISCOUNT = dISCOUNT; 
	}
	
	public String getID() {
		return iD;
	}

	public void setID(String iD) {
		this.iD = iD;
	} 
	
	public String getLEVEL() {
		return lEVEL;
	}

	public void setLEVEL(String lEVEL) {
		this.lEVEL = lEVEL;
	} 
	
	public String getLEVELNAME() {
		return lEVELNAME;
	}

	public void setLEVELNAME(String lEVELNAME) {
		this.lEVELNAME = lEVELNAME;
	} 
	
	public String getDISCOUNT() {
		return dISCOUNT;
	}

	public void setDISCOUNT(String dISCOUNT) {
		this.dISCOUNT = dISCOUNT;
	} 
	
	
	public Map level_discountToMap() {
		Map map = new HashMap();
		try {
			map.put("iD",this.iD);
			map.put("lEVEL",this.lEVEL);
			map.put("lEVELNAME",this.lEVELNAME);
			map.put("dISCOUNT",this.dISCOUNT);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return map;
	}

	public Level_discount mapToLevel_discount(Map map){
		try {
			String iD =  map.get("iD").toString();
			String lEVEL =  map.get("lEVEL").toString();
			String lEVELNAME =  map.get("lEVELNAME").toString();
			String dISCOUNT =  map.get("dISCOUNT").toString();
			Level_discount level_discount = new Level_discount(iD, lEVEL, lEVELNAME, dISCOUNT);
			return level_discount;
		} catch (Exception e) {
			e.printStackTrace();
			return null;
		}
	} 
	
	public String toString(){
		return level_discountToMap().toString();
	}
	
	//方便数据操作	
	public Level_discount insert(){
		return DB.insert(this);
	}
	public Level_discount update(){
		return DB.update(this);
	}
	
	public int delete(){
		return DB.delete(this);
	}
	
}
